<?php
include_once("../configure/configure.php");						//--> global var
include_once("../admin/configure/admin.config.inc.php");		//-- admin var
include_once("../admin/tools/smarty/libs/Smarty.class.php");	//--> out template

include_once("impl/ShareCouponImpl.php");
include_once("impl/PromotionTypeImpl.php");

include_once("../includeSmarty.php");
include_once("../includeTag.php");
include_once("../includeCategories.php");

include_once("checkLogin.php");// check login status
include_once("control.php");// user global action control

$shareImpl 		= new ShareCouponImpl(DB_TAG_COUPON);
$promoTypeImpl	= new PromotionTypeImpl(DB_TAG_COUPON);

$id 			= $_GET['id'];
$oShareCoupon 	= null;

if(!empty($id)){
	$oShareCoupon = $shareImpl->getById($id);
}


$arrPromoType = $promoTypeImpl->getSelect();

$smarty->assign('oTags', $oTags);
$smarty->assign('oCatTree', $oCatTree);

$smarty->assign('HOME_URL', HOME_URL);
$smarty->assign('HOME_URL_HTTP', HOME_URL_HTTP);

$smarty->assign('message', $error_message);
$smarty->assign('oShareCoupon', $oShareCoupon);

$smarty->assign('name', $name);
$smarty->assign('store', $store);
$smarty->assign('code', $code);
$smarty->assign('promoTypeId', $promoTypeId);
$smarty->assign('descript', $descript);
$smarty->assign('startDate', $startDate);
$smarty->assign('endDate', $endDate);

$smarty->display('viewCoupon.html');
?>
